<style>
.layui-input-block{
margin-left:120px;
}
</style>
<form class="layui-form" action="" id="orderEditForm">
<!-- 隐藏域用于传递ID -->
<input  class="form-control formSubmit layui-hide" name="id" />
 <div class="layui-row"  style="margin-top:10px;">

	  <div class="layui-col-xs6 layui-col-sm6 layui-col-md6">
	    <label class="layui-form-label" style="width:120px;">公司</label>
	    <div class="layui-input-block" style="width:200px;">
	          <select style="width:200px;height:28px;" name="company_id" lay-verify="required" required >
	      		   <option th:each="ec:${actCenterCompanyMap}" th:value="${ec.id}" th:text="${ec.name}"></option> 
	      	   </select>
	    </div>
	  </div>
  	 
	  <div class="layui-col-xs6 layui-col-sm6 layui-col-md6">
		    <label class="layui-form-label" style="width:120px;">角色</label>
		    <div class="layui-input-block" style="width:200px;">
		       <select style="width:200px;height:28px;" name="role_id" lay-verify="required" required >
	      		   <option th:each="ec:${sysRoleMap}" th:value="${ec.id}" th:text="${ec.name}"></option> 
	      	   </select>
		    </div>
	   </div>
  </div>
  
  
 <div class="layui-row" style="margin-top:10px;">
 	<div class="layui-col-xs6 layui-col-sm6 layui-col-md6">
		    <label class="layui-form-label" style="width:120px;">产品</label>
		    <div class="layui-input-block" style="width:200px;">
		       <select style="width:200px;height:28px;" name="product_id" lay-verify="required" required>
	      		   <option th:each="ec:${actCenterProductMap}" th:value="${ec.id}" th:text="${ec.name}"></option> 
	      	   </select>
		    </div>
	   </div>
	  
	  <div class="layui-col-xs6 layui-col-sm6 layui-col-md6">
	    <label class="layui-form-label" style="width:120px;" lay-filter="supplierContacts">费用</label>
	    <div class="layui-input-block" style="width:200px;">
	    	<input type="text" class="layui-input" name="price" lay-verify="required" />
	    </div>
	  </div>
 </div>
  <div class="layui-row" style="margin-top:10px;">
  	  <div class="layui-col-xs6 layui-col-sm6 layui-col-md6">
	    <label class="layui-form-label" style="width:120px;" lay-filter="supplierContacts">开始时间</label>
	    <div class="layui-input-block" style="width:200px;">
	      <input type="text" style="width:200px;" name="begin_time" lay-verify="required" class="layui-input Date_time">
	    </div>
	  </div>
  	  <div class="layui-col-xs6 layui-col-sm6 layui-col-md6">
	    <label class="layui-form-label" style="width:120px;" lay-filter="supplierContacts">结束时间</label>
	    <div class="layui-input-block" style="width:200px;">
		   <input type="text" style="width:200px;" name="end_time" lay-verify="required" class="layui-input Date_time">
	    </div>
	   </div>
  </div>
   
  <div class="layui-row" style="margin-top:10px;">
	  
	   <div class="layui-col-xs12 layui-col-sm12 layui-col-md12">
		    <label class="layui-form-label" style="width:120px;">备注</label>
		    <div class="layui-input-block" style="width:540px;">
		      <textarea  class="layui-textarea" name="remark" ></textarea>
		    </div>
	   </div>
  </div>
  
 <div class="layui-row" style="margin-top:20px;">
    <div class="layui-col-xs12 layui-col-sm12 layui-col-md12" style="text-align:center;">
      	<button type="button" class="layui-btn" id="submitBtn" lay-submit="" lay-filter="formSubmit" authcode="900064">提交</button>
      	<button type="button" class="layui-btn layui-btn-primary" id="closeBtn">关闭</button>
    </div>
  </div>
</form>
<script>
layui.use('laydate', function(){
	  var laydate = layui.laydate;
	  lay('.Date_time').each(function(){
		    laydate.render({
		      elem: this
		      ,type:'datetime'
		      ,trigger: 'click'
		    });
		  });
	});
	
layui.use('form', function(){
	var form = layui.form;
	form.render();
	form.on('submit(formSubmit)', function(data){
		  $.ajax({
	            type: "GET",
	            url: "/act/center/company/product/create_execute",
	            data: $("#orderEditForm").serializeJson(),
	            dataType: "json",
	            success: function(data){
	            	if(data.code==200){
	           	    //更新表格数据
	           	    layer.msg(data.message,{icon: 6});
	           		//更新表格诗句
	           	 	reloadData();
	           		//关闭弹出层
	           	    layer.closeAll();
	            	}else{
	            		layer.msg(data.message,{icon: 2});
	            	}
	            }
	           });
		  //关闭弹出层
	   	    layer.closeAll();
	  });
	  
	  function reloadData(){
			$(".layui-laypage-btn")[0].click();//页面的确定按钮
			
		}
		 //关闭按钮
		  $("#closeBtn").click(function(){
			  layer.closeAll();
		  })
	});  
</script>
